package edu.sctu.java.advanced.pattern.proxy.lab03;

import edu.sctu.java.advanced.reflection.lab01.User;

public class Client {
    public static void main(String[] args) {

        // (1) 定义Interceptor，说明具体的代理事务；
        MyMethodInterceptor interceptor = new MyMethodInterceptor();

        // (2) 通过Interceptor创建代理对象；
        User userProxy = (User) interceptor.getProxyInstance(User.class);
        userProxy.getName();

        Book bookProxy = (Book) interceptor.getProxyInstance(Book.class);
        bookProxy.getPress();

    }
}
